package com.weifangfirecontrolformal.weifangfirecontrolformal.web.web.maintenancesystem.basisinfo;

import cn.hutool.json.JSONObject;
import com.weifangfirecontrolformal.weifangfirecontrolformal.common.base.BaseController;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.annotaion.Action;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.annotaion.At;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.model.RespEntity;
import com.weifangfirecontrolformal.weifangfirecontrolformal.web.service.maintenancesystem.basisinfo.CommonService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.annotation.Resource;

/**
 * @Author: YangYu
 * @ClassName: CommonController
 * @Date: Created in 14:28 2020/12/23
 * @Description: 通用控制器
 */
@Action
@RequestMapping(value = "basisinfo/common")
public class CommonController extends BaseController {

    @Resource
    private CommonService commonService;

    /**
     * @Author YangYu
     * @Description 行政区划列表
     * @Date Created in 13:47 2020/12/23
     * @Param [jsonParam]
     */

    @At(value = "regionList", method = RequestMethod.GET)
    public RespEntity regionList(@RequestBody(required = false) JSONObject jsonParam) {
        return commonService.regionList(jsonParam);
    }


    /**
     * @Author YangYu
     * @Description 行政区划分页列表
     * @Date Created in 14:32 2021/1/7
     * @Param [jsonParam]
     */

    @At(value = "regionPagList", method = RequestMethod.GET, param = {"page", "limit"})
    public RespEntity regionPagList(@RequestBody(required = false) JSONObject jsonParam) {
        return commonService.regionPagList(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 获取省、市、区的下拉列表
     * @Date Created in 14:32 2021/1/7
     * @Param [jsonParam]
     */

    @At(value = "getRegionDownList", method = RequestMethod.GET)
    public RespEntity getRegionDownList(@RequestBody(required = false) JSONObject jsonParam) {
        return commonService.getRegionDownList(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 隶属单位不分页列表
     * @Date Created in 13:55 2020/12/23
     * @Param [jsonParam]
     */

    @At(value = "subjectionBusinessList", method = RequestMethod.GET)
    public RespEntity subjectionBusinessList(@RequestBody(required = false) JSONObject jsonParam) {
        return commonService.subjectionBusinessList(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 隶属单位分页列表
     * @Date Created in 16:59 2020/12/23
     * @Param [jsonParam]
     */

    @At(value = "subjectionBusinessPagList", method = RequestMethod.GET, param = {"page", "limit"})
    public RespEntity subjectionBusinessPagList(@RequestBody(required = false) JSONObject jsonParam) {
        return commonService.subjectionBusinessPagList(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 消防机构列表
     * @Date Created in 14:38 2020/12/23
     * @Param [jsonParam]
     */

    @At(value = "organizationFireList", method = RequestMethod.GET)
    public RespEntity organizationFireList(@RequestBody(required = false) JSONObject jsonParam) {
        return commonService.organizationFireList(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 消防设施列表
     * @Date Created in 14:49 2020/12/23
     * @Param [jsonParam]
     */

    @At(value = "fireControlFacilitiesList", method = RequestMethod.GET)
    public RespEntity fireControlFacilitiesList(@RequestBody(required = false) JSONObject jsonParam) {
        return commonService.fireControlFacilitiesList(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 字典列表
     * @Date Created in 10:00 2020/12/24
     * @Param [jsonParam]
     */

    @At(value = "dictList", method = RequestMethod.GET)
    public RespEntity dictList(@RequestBody(required = false) JSONObject jsonParam) {
        return commonService.dictList(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 设备类型列表
     * @Date Created in 10:07 2020/12/28
     * @Param [jsonParam]
     */

    @At(value = "deviceTypeList", method = RequestMethod.GET)
    public RespEntity deviceTypeList(@RequestBody(required = false) JSONObject jsonParam) {
        return commonService.deviceTypeList(jsonParam);
    }
}
